package com.kapcb.common.request;

import java.io.Serializable;

/**
 * <a>Title: BasePage </a>
 * <a>Author: cb <a>
 * <a>Description: BasePage <a>
 *
 * @author cb
 * @version 1.0
 * @date 2024/4/19 17:32
 * @since 1.0
 */
public class BasePage implements Serializable {

    private static final long serialVersionUID = 7851210256083892285L;

    /**
     * 当前页码
     */
    protected Long pageNum;

    /**
     * 分页条数
     */
    protected Long pageSize;

    public Long getPageNum() {
        return pageNum;
    }

    public void setPageNum(Long pageNum) {
        if (pageNum == null || pageNum == 0) {
            pageNum = 1L;
        }
        this.pageNum = pageNum;
    }

    public Long getPageSize() {
        return pageSize;
    }

    public void setPageSize(Long pageSize) {
        if (pageSize == null || pageSize == 0) {
            pageSize = 10L;
        }
        this.pageSize = pageSize;
    }

    public BasePage() {
    }

    public BasePage(Long pageNum, Long pageSize) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
    }

    @Override
    public String toString() {
        return "BasePage{" +
                "pageNum=" + pageNum +
                ", pageSize=" + pageSize +
                '}';
    }
}
